/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.applicatioN.entities;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Slim
 */
@Entity
@Table(name = "software")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Software.findAll", query = "SELECT s FROM Software s"),
    @NamedQuery(name = "Software.findBySoftware", query = "SELECT s FROM Software s WHERE s.software = :software"),
    @NamedQuery(name = "Software.findByEditeur", query = "SELECT s FROM Software s WHERE s.editeur = :editeur")})
public class Software implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "SOFTWARE")
    private String software;
    @Basic(optional = false)
    @Column(name = "EDITEUR")
    private String editeur;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "software1")
    private Collection<Exiger2> exiger2Collection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "software1")
    private Collection<MaitriserSoft> maitriserSoftCollection;

    public Software() {
    }

    public Software(String software) {
        this.software = software;
    }

    public Software(String software, String editeur) {
        this.software = software;
        this.editeur = editeur;
    }

    public String getSoftware() {
        return software;
    }

    public void setSoftware(String software) {
        this.software = software;
    }

    public String getEditeur() {
        return editeur;
    }

    public void setEditeur(String editeur) {
        this.editeur = editeur;
    }

    @XmlTransient
    public Collection<Exiger2> getExiger2Collection() {
        return exiger2Collection;
    }

    public void setExiger2Collection(Collection<Exiger2> exiger2Collection) {
        this.exiger2Collection = exiger2Collection;
    }

    @XmlTransient
    public Collection<MaitriserSoft> getMaitriserSoftCollection() {
        return maitriserSoftCollection;
    }

    public void setMaitriserSoftCollection(Collection<MaitriserSoft> maitriserSoftCollection) {
        this.maitriserSoftCollection = maitriserSoftCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (software != null ? software.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Software)) {
            return false;
        }
        Software other = (Software) object;
        if ((this.software == null && other.software != null) || (this.software != null && !this.software.equals(other.software))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.applicatioN.entities.Software[ software=" + software + " ]";
    }
    
}
